package chen.web.favorite;

import java.util.Date;

import chen.web.IdEntity;
import chen.web.user.Account;

public class Favorite extends IdEntity{
	
	private String title;
	private String description;
	private String type;
	private Date date;
	private String uri;
	private Account owner;
	private int flag;
	
	public Favorite(Object source){
		super(0);
		this.setType(getType(source.getClass()));
		this.date = new Date();
	}
	
	Favorite(){
		super(0);
	}
	
	public int getId() {
		return id;
	}
	void setId(int id) {
		this.id = id;
	}
	public Date getDate() {
		return date;
	}
	void setDate(Date date){
		this.date = date;
	}
	int getFlag() {
		return flag;
	}
	void setFlag(int flag) {
		this.flag = flag;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getTitle() {
		return title;
	}

	void setUri(String uri) {
		this.uri = uri;
	}

	public String getUri() {
		return uri;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getDescription() {
		return description;
	}
	
	void setOwner(Account owner) {
		this.owner = owner;
	}

	public Account getOwner() {
		return owner;
	}

	void setType(String type) {
		this.type = type;
	}

	public String getType() {
		return type;
	}
	
	static String getType(Class<?> clazz){
		return clazz.getSimpleName().toLowerCase();
	}
}
